<template>
	<view>
		<view v-for="(item,index) in reco_list" :key="item.id" class="truck_item">
			<view class="div_item">
				<view>发站<span>{{item.send || '--'}}</span></view>
				<view>到站<span>{{item.arrive || '--'}}</span></view>
			</view>
			<view class="div_item">
				<view>运费<span>¥{{item.freight || '--'}}</span></view>
				<view>抵扣金额<span>¥{{item.use_money || '--'}}</span></view>
			</view>
			<view class="div_item">
				<!-- <view>核销网点<span>{{item.site_id || '--'}}</span></view> -->
				<view>使用时间<span>{{item.use_time_text || '--'}}</span></view>
			</view>
			<view class="div_item">
				<view>备注<span>{{item.remark || '--'}}</span></view>
				<!-- <view><span style="font-weight: bold;" @click.stop="onRecoUseList">查看使用记录</span></view> -->
			</view>

			<!-- 占位布局 -->
			<view style="width: 10%;height: 14rpx;"></view>

			<!-- 底部操作菜单 -->
			<!-- <view class="op_menu_div">
				<view class="btn_share" @click.stop="onApply(item)">操作按钮</view>
			</view> -->

		</view>

		<view v-if="!reco_list || reco_list.length <= 0" style="width: 100%;text-align: center;margin: 10vh 0 0 0;">
			暂无数据~
		</view>

	</view>
</template>

<script>
	import { getUInfo, getStatusTxt } from '@/util/util.js'
	export default {

		data() {
			return {
				reco_list: [], // 记录列表
			}
		},

		mounted() {
			let that = this

			that.getRecoList()
		},

		onLoad(opts) {
			// console.log('opts = ', opts.item)
			// this.reco_list = JSON.parse(opts.item).record
		},

		methods: {

			async getRecoList() {
				let that = this
				let token = getUInfo().token
				let var_page = 1
				let list_rows = 99999999
				uni.showLoading({ title: '处理中', mask: true, })
				let res = await this.$receive_list({ token })
				// console.log('$receive_list.res =', res);
				if (res.code == 1) {
					this.reco_list = res.data
				} else {
					uni.showToast({ title: res.msg || '数据异常', icon: 'none' })
				}
			},

			getStatusTxt(status) {
				return getStatusTxt(status)
			},

		}
	}
</script>

<style scoped>
	.truck_item {
		margin: 20rpx;
		border: solid 1rpx rgba(0, 0, 0, 0.15);
		border-radius: 10rpx;
	}

	.div_item {
		display: flex;
		align-items: center;
		justify-content: space-between;
		margin: 14rpx 14rpx 0 14rpx;
		font-size: 28rpx;
	}

	span {
		/* display: block; */
		margin: 0 0 0 10rpx;
		color: #1890FF;
		font-size: 26rpx;
	}

	.op_menu_div {
		display: flex;
		justify-content: flex-end;
		padding: 14rpx;
	}

	.btn_share {
		background-color: #1890FF;
		width: 118rpx;
		height: 52rpx;
		line-height: 52rpx;
		text-align: center;
		font-size: 24rpx;
		color: white;
		border-radius: 4rpx;
		margin: 0 0 0 12rpx;
	}
</style>